1. Field of the Invention
The present invention relates to a key storage error processing system which remedies errors in reference and update bits of a key storage.
2. Description of the Prior Art
FIG. 1 illustrates the relationship between a main storage and a key storage. Reference character MS indicates generally a main storage; P designates pages; K identifies a main storage key; A denotes an access-control bit; F represents a fetch-protection bit; R shows a reference bit; and C refers to a change bit. The main storage MS is split into a plurality of pages P, each consisting of a 2K-byte block, for instance, and each associated with one main storage key K. The main storage key K is stored in a key storage (not shown). An information processing system equipped with such a main storage and a key storage as mentioned above is disclosed, for example, in IBM System/370 Principles of Operation.
Whenever information is stored or fetched, the access-control bit A of the main storage key K is matched with a program-protection key, thereby performing storage protection of the main storage MS. The fetch-protection bit F indicates whether the storage protection is applied when information is fetched from the main storage MS. The reference bit R indicates whether the corresponding page of the main storage is being accessed, and when the page is accessed, the reference bit R of the main storage key K corresponding to the page is set to a "1". The change bit C indicates whether changed information is stored in the corresponding page of the main storage MS, and when changed information is stored in the page, the change bit C of the corresponding main storage key K is set to a "1".
The reference bit R and the change bit C are used when information is transferred in units of pages, to the main storage MS from an external storage, such as a magnetic disc unit. For instance, in a computer system of a virtual storage system type, information is fetched and stored on the assumption that the storage area of an external storage exists in the main storage. Accordingly, when information being required is not in the main storage MS, the information is paged-in from the external storage to the main storage MS and an area must be secured therefor in the main storage MS. In this case, if there is no space in the main storage MS, a search is made for an area or page that is considered unnecessary and its information is paged-out into the external storage to free the area for receiving the information from the external storage.
In such a page-out operation, priorities are usually attached to the pages for making the search for an unnecessary area. FIG. 2 shows the relationship between the priority and the reference and change bits R and C. When the change bit C is "0", it indicates that the contents of the page of the main storage MS corresponding to the main storage key K remain unchanged and, accordingly, the same contents are stored in the external storage and the contents of the page need not be transferred thereto. That is, the page-out operation is unnecessary. The reference bit R indicates whether the page of the main storage MS corresponding to the main storage key K is being accessed or not. Accordingly, when the reference bit R and the change bit C are both "0", the contents of the corresponding page are not changed, nor is it being accessed, so that the page is given the highest priority for a save. When the reference bit R and the change bit C are both "1", the contents of the page are changed and it is being accessed and, accordingly, the page is given the fourth priority for a save. Incidentally, the reference bit R is set to " 0" by the execution of a reset reference bit instruction when the key storage is retrieved for a fixed period of time or for the page-out operation.
It is general practice to add a parity bit for detection of an error in the reference bit R and the change bit C. FIG. 3 is explanatory of a conventional error processing system employing odd parity. In FIG. 3, (a) shows the case where two bits of a pair of the reference bit R or the change bit C and a parity bit are correct at a time t1; (b) shows the case where when the reference bit R or the change bit C is read out at a time t2 after the lapse of an arbitrary period of time, one of the two bits is erroneous; and (c) shows the case where the reference bit R or the change bit C is read out at a time t3 a certain period of time after the time t2 and the other bit is also erroneous. An asterisk indicates the erroneous bit. (1), (3), (5) and (7) show the pair of the reference bit R or the change bit C and the parity bit, and (2), (4) (6) and (8) show bits that are transferred to an access control unit of the main storage MS for the decision of the page-out and so on.
For instance, when the main storage key K is read out at the time t1 as shown in (a)-(1) or (a)-(3), "01" which is a pair of "0" of the reference bit R or the change bit C and "1" of the parity bit is correct and, consequently, a "0" shown in (a)-(2) or (a)-(4) is transferred to the access control unit of the main storage MS. When the readout takes place again at the subsequent time t2, if a one-bit error occurs resulting in "11" as shown in (b)-(1), the error is detected by a parity check and a "1" shown in (b)-(2) is transferred to the access control unit. That is, when an error is detected by the parity check, a "1" indicating an access or a change is transferred to the access control unit. Further, when the other bit also becomes erroneous at the time t3 to provide "10" as shown in (c)-(1), it is decided as error-free by the parity check and a "1" shown in (c)-(2) is transferred to the access control unit. Also in the case where the main storage key K is read out at the time t2 and a one-bit error occurs to provide "00", a "1" shown in (b)-(4) is transferred to the access control unit. Moreover, when the other bit becomes erroneous to provide "10" as shown in (c)-(3), it is decided as error-free by the parity check and a "1" shown in (c)-(4) is transferred to the access control unit.
When the reference bit R is changed from a "0" to a "1", the priority for the saving of the page corresponding to the main storage key is lowered and even if its priority is the first or second highest one, it is given the third or fourth highest priority. This merely reduces the number of pages of high priority which are to be saved, but does not impair the system performance. When the change bit C is changed from a "0" to a "1", the priority for the saving of the page in lowered as is the case with the reference bit. When the page corresponding to the main storage key is designated to be saved, the page-out operation takes place. This means that the page-out operation, which is omissible if the change bit C is a "0", is carried out, thus, resulting in a somewhat lowered system performance, but this does not matter so seriously.
In the case where the correct content of the bit pair is "10" as shown in (a)-(5), if the reference bit R or the change bit C becomes erroneous as shown in (b)-(5), a "1" shown in (b)-(6) is transferred to the access control unit as the result of a parity check. However, if the content becomes "01" owing to an error of the other bit at the time of reading out the main storage key K at the time t3 as shown in (c)-(5), the content is decided as error-free by the parity check and a "0" shown in (c)-(6) is transferred to the access control unit. The same is true of the case where the content "10" of the bit pair at the time t1 changes to "11" at the time t2 and then changes to "01" at the time t3 as shown in (7). In this way, a change in the reference bit R or the change bit C raises save priority, and this introduces the possibility of saving a page which ought not to be saved. As a consequence, there are some occasions when the page which may well be in use is paged-out and then paged-in, resulting in appreciably impaired system performance. Moreover, when the change bit C changes from a "1" to a "0" due to an error, data rewritten in the main storage is destroyed by the omission of the page-out operation which saves the changed data. Accordingly, the system breaks down under the worst case.